﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Light.IoC
{
    /// <summary>
    /// IoC工厂接口
    /// </summary>
    public interface IFactory : IDisposable
    {
        /// <summary>
        /// 创建组件实例
        /// </summary>
        /// <typeparam name="T">组件类型</typeparam>
        /// <returns></returns>
        T Create<T>();

        /// <summary>
        /// 创建组件实例
        /// </summary>
        /// <typeparam name="T">组件类型</typeparam>
        /// <param name="key">组件类型配置文件中节点key值</param>
        /// <returns></returns>
        T Create<T>(string key);


        /// <summary>
        /// 创建组件实例
        /// </summary>
        /// <param name="type">组件类型</param>
        /// <returns></returns>
        object Create(Type type);
    }
}
